<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>此例从事件处理器调用一个函数</title>
</head>
<body>
    <h1 onclick="changetext(this)">点击文本!</h1>
    <script>
        function changetext(id){
            id.innerHTML="Ooops!";
        }
    </script>
</body>
</html>